﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.DS
{
    public static partial class statistics
    {
        public static dynamic getDSCharPidSet(int eid)
        {
            var sql = new Sql.SqlDataContext();
            if (!sql.DSExperiment.Any(row => row.eid == eid)) return new
            {
                success = false,
                msg = "实验不存在"
            };
            var ps = sql.DSProblem.Where(row => row.eid == eid).OrderBy(row => row.pid);
            var charPidSet = new List<string>();
            foreach (var p in ps)
            {
                charPidSet.Add(((char)(65 + p.pid)).ToString());
            }
            return new
            {
                success = true,
                charPidSet
            };
        }
    }
}
